<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //评论
        Schema::create('comment', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('content')->nullable()->comment('评论内容');
            $table->integer('unit_id')->default(0)->comment('单位id');
            $table->integer('news_id')->default(0)->comment('资讯id');
            $table->string('type')->nullable()->comment('类型 unit：单位评论 news：资讯评论 expert：专家评论');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
